package com.cxb.java.face.threadLocal;

/**
 * @Classname Test
 * @Date 2023/9/10 17:56
 * @Created by Administrator
 * @Description TODO
 */
public class Test1 {
    public static void main(String[] args) {
        ThreadLocal<Object> threadLocal = new ThreadLocal<>();
        threadLocal.set("threadLocal");

        InheritableThreadLocal<Object> inheritableThreadLocal = new InheritableThreadLocal<>();
        inheritableThreadLocal.set("test + inheritableThreadLocal");

        Thread t = new Thread(() -> {
            System.out.println(threadLocal.get());
            System.out.println(inheritableThreadLocal.get());
        });
        t.start();
    }
}
